
<?php     
    $list_quotation_number = array();
    $list_quotation_id = array();
    foreach ($list_quotation->result() as $row) {
        $list_quotation_id[] = $row->id_quotation;
        $list_quotation_number[] = $row->nomor_quotation;
    }
    
    $list_quotation_id = implode(",", $list_quotation_id);
    $list_quotation_number = implode("\n", $list_quotation_number);
    
    if($using_dollar_currency > 0){
        $crc_text = "$ ";
    } else {
        $crc_text = "Rp. ";
    }
?>
<table>
    <tr>
        <td width="15%">&nbsp;</td>
        <td width="1%">&nbsp;</td>
        <td width="30%">&nbsp;</td>
        <td width="8%">&nbsp;</td>
        <td width="15%">&nbsp;</td>
        <td width="1%">&nbsp;</td>
        <td width="30%">&nbsp;</td>
    </tr>
    <tr>
        <td>Date</td>
        <td>:</td>
        <td><?php echo $tanggal_po;?></td>      
        <td colspan="4">&nbsp;&nbsp;&nbsp;</td>    
    </tr>  
    <tr>
        <td>List Quotation Number</td>
        <td>:</td>
        <td><?php echo $list_quotation_number;?></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>PO Note</td>
        <td>:</td>
        <td><?php echo $catatan_po;?></td>
    </tr> 
    <tr>
        <td>Requester</td>
        <td>:</td>
        <td><?php echo $nama_customer;?></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td>PO NO</td>
        <td>:</td>
        <td><?php echo $nomor_po;?></td>
    </tr>
    <tr>
        <td>Address</td>
        <td>:</td>
        <td><?php echo $alamat_detail_customer?></td>
        <td colspan="4">&nbsp;&nbsp;&nbsp;</td>    
    </tr>
    <tr>
        <td>Full Address</td>
        <td>:</td>
        <td><?php echo $alamat_komplit;?></td>
        <td colspan="4">&nbsp;&nbsp;&nbsp;</td>    
    </tr>
    <tr>
        <td>Phone/Fax/Email</td>
        <td>:</td>
        <td><?php echo $kontak_komplit;?></td>
        <td colspan="4">&nbsp;&nbsp;&nbsp;</td>    
    </tr>  
</table>
<br/>
<br/><br/>

<table border="1" cellpadding="8px" style="width: 100%;">
    <thead>
        <tr class="GridHeader">
            <td>No.</td>
            <td>Description</td>
            <td>Qty</td>
            <td>Unit Price</td>
            <td>Total Price</td>
        </tr>
    </thead>
    <tbody id="tablebody">
        <?php 
            $total_harga = 0;
            if(is_object($item)){
            if($item->num_rows() > 0) {
                $nomor = 1;
                foreach($item->result() as $row){
                    if($crc > 0){
                        $crc_nom = $row->harga_jual_dollar;
                    } else {
                        $crc_nom = $row->harga_jual;
                    }
        ?>
                <tr class="GridItem1">
                    <td><?php echo $nomor++;?></td>
                    <td><?php echo $row->nama_item?></td>
                    <td><?php echo $row->quantity . " " . $row->satuan_beli?></td>
                    <td align="right"><span style="float: left;"><?php echo $crc_text?></span><?php echo number_format($crc_nom, 0, ',', '.')?></td>
                    <td align="right"><span style="float: left;"><?php echo $crc_text?></span><?php echo number_format($crc_nom * $row->quantity, 0, ',', '.')?></td>
                 </tr>
        <?php 
                    $total_harga += $crc_nom * $row->quantity;
                }
            } else {
                ?>
                 <tr class="GridItem1" id="no_item">
                    <td colspan="5">Tidak ada data</td>
                </tr>
                 <?php
            }
            }
        ?>
    </tbody>
    <tfoot>
        <tr class="GridHeader">
            <td colspan="4" align="right">Total</td>
            <td align="right"><span style="float: left;"><?php echo $crc_text?></span><?php echo number_format($total_harga, 0, ',', '.')?></td>
            <td>&nbsp;</td>
        </tr>
    </tfoot>
</table> 